#include "frenet.h"
#include <math.h>

#include <iostream>
using namespace std;

frenet::frenet(): vectorPosition(this,Vector3(0,0,0)),vectorFirstDerivative(this,Vector3(0,0,0)), vectorSecondDerivative(this, Vector3(1,0,0))
{}

void frenet::doUpdate()
{
	//cout<<"curvature Frenet --> x="<<vectorSecondDerivative.getValue().x<<" y="<<vectorSecondDerivative.getValue().y<<" z="<<vectorSecondDerivative.getValue().z<<endl;
	Matrix m;
	Vector3 curvature = vectorSecondDerivative.getValue();

	//curvature.x=1;
	//curvature.y=0;
	//curvature.z=0;
	m=tsg::math::frenet(vectorPosition,vectorFirstDerivative,curvature);
	
	setValue(m);
}
